<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="WEB-INF/template.xhtml">
    <ui:param name="page_title" value="Login"/>
    <h:form id="formLogin" rendered="#{sessionScope.account == null}">
        <h:outputLabel for="name" id="lblName" value="Name" />
        <h:inputText value="#{LoginBackingBean.name}" id="name" />
        <p:message for="name"/>
        <h:outputLabel for="password" id="lblPassword" value="Password" />
        <h:inputSecret redisplay="false" value="#{LoginBackingBean.password}" id="password" />
        <p:message for="password"/>
        <h:commandButton value="Submit" id="btnSubmit" action="#{LoginControllerBean.login()}"/>
        <h:outputLink value="register.jsf">Register</h:outputLink>
    </h:form>
    <h:outputText value="You are logged in." rendered="#{sessionScope.account != null}"/>
</ui:composition>
